// Do not remove the include below
#include "RFReceiverModuleTest.h"
#include "USBSerialModule.h"
#include "Streaming.h"
#include "HardwareSerial.h"
#include "RFSenderModule.h"
#include "RFReceiverModule.h"
//extern HardwareSerial Serial;

//The setup function is called once at startup of the sketch
//SenderModule* sender;
//ReceiverModule* receiver;
extern HardwareSerial Serial;
ReceiverModule *receiverM;
SenderModule *senderM;

void setup() {
// Add your initialization code here
//	senderM=new RFSenderModule("sender",4000,2,1);
	receiverM = (ReceiverModule*)new RFReceiverModule(2,4000);
	senderM = new USBSerialModule(115200);
	Serial << "RFReceiverModule Test" << endl;

}

// The loop function is called in an endless loop
void loop() {
	Serial << "loop" << endl;
	Message rx = receiverM->receiveMessage();
	Serial << "received & sending:"<<rx.getContent() << endl;
	Message msg = rx.getContent();
	if (msg.getContent() != NULL) {

		senderM->sendMessage(msg);
	delay(1000);
	}
//	Message msg = Message("yebatnau");
//	Serial << msg.getContent() << endl;

}
